package com.megvii.corelib.components;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.RelativeLayout;

import com.megvii.corelib.R;


/**
 * Created by linyue on 15/12/22.
 */
public class ProgressBarView extends RelativeLayout
{
    public ProgressBarView(Context context)
    {
        super(context);
        init(context);
    }

    public ProgressBarView(Context context, AttributeSet attrs)
    {
        super(context, attrs);
        init(context);
    }

    public ProgressBarView(Context context, AttributeSet attrs, int defStyle)
    {
        super(context, attrs, defStyle);
        init(context);
    }

    public void init(Context context)
    {
        inflate(context, R.layout.progressbar_layout, this);
        hide();
    }


    public void show()
    {
        this.setVisibility(View.VISIBLE);
        this.bringToFront();
        this.requestLayout();
    }

    public void hide()
    {
        this.setVisibility(View.GONE);
    }
}
